package com.asset.inventory.kt

import android.text.TextUtils
import android.util.Log
import java.lang.StringBuilder

/**
 * 页面名称：字符串拓展函数
 * 创建时间  2021/04/07 20:48
 */

private const val TAG = "BINBIN"

fun String.logE(tag: String = TAG){
    Log.e(tag,this)
}

fun String.isEmpty(): Boolean = TextUtils.isEmpty(this)

fun String.convertHexToString(): String{
    val sb = StringBuilder()
    val temp = StringBuffer()
    for(i in this.indices step 2){
        val output = this.substring(i,(i + 2))
        val decimal = output.toInt(16)
        sb.append(decimal.toChar())
        temp.append(decimal)
    }
    return sb.toString()
}
